<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{$Think.lang.banneradd}</title>
    <link rel="stylesheet" href="__ADMIN__/vendor/layui/css/layui.css">
    <link rel="stylesheet" href="__ADMIN__/custom/css/style.css">
</head>
<body style="padding:10px 10px;">
<div class="layui-container">
    <form class="layui-form" action="{:url('banner/save')}" method="post" enctype="multipart/form-data">
        <div class="layui-form-item">
            <label class="layui-form-label">{$Think.lang.title}</label>
            <div class="layui-input-block">
                <input type="text" name="title" required  lay-verify="required" placeholder="{$Think.lang.title}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{$Think.lang.pic}</label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="uplodimg">
                    <i class="layui-icon">&#xe67c;</i>{$Think.lang.uploadimg}
                </button>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{$Think.lang.weburl}</label>
            <div class="layui-input-block">
                <input type="text" name="url" required  lay-verify="required" placeholder="{$Think.lang.weburl}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{$Think.lang.isshow}</label>
            <div class="layui-input-inline">
                <input type="checkbox" name="isshow" lay-skin="switch" lay-text="显示|隐藏" value="1" checked>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{$Think.lang.sort}</label>
            <div class="layui-input-inline">
                <input type="text" name="sort" value="50" required  lay-verify="required" placeholder="{$Think.lang.sort}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{$Think.lang.jians}</label>
            <div class="layui-input-block">
                <textarea name="remark" placeholder="{$Think.lang.jians}" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">{$Think.lang.add}</button>
            </div>
        </div>
    </form>
</div>
<script src="__ADMIN__/vendor/js/jquery.js"></script>
<script src="__ADMIN__/vendor/layui/layui.js"></script>
<script src="__ADMIN__/custom/js/admin.js"></script>
<script>
    layui.use(['form','upload'], function(){
        var form = layui.form;
        var upload = layui.upload;
        //上传按钮
        var uploadInst = upload.render({
            elem: '#uplodimg' //绑定元素
            ,auto:false
            ,field:'pic'
            ,exts:"jpg|png"
            ,done: function(res){
                //上传完毕回调
            }
            ,error: function(){
                //请求异常回调
            }
        });
        //监听提交
        form.on('submit(formDemo)', function(data){
        });
    });
   $(function(){
        $(window.parent.document).find('#righttitle').text($('title').text());
   });
</script>
</body>
</html>